package org.example.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.example.entity.Candidateresume;
import org.example.mapper.CandidateresumeMapper;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CandidateresumeService extends ServiceImpl<CandidateresumeMapper, Candidateresume> {
    public List<Candidateresume> resumeInquiryDepartment(String status) {
        return baseMapper.resumeInquiryDepartment(status);
    }

    public List<Candidateresume> queryBasedOnTheDemandStatusAndJobName(
            @Param("status") String status,
            @Param("jobName") String jobName,
            @Param("requirements") String requirements) {
        return baseMapper.queryBasedOnTheDemandStatusAndJobName(status, jobName, requirements);
    }
    public List<Candidateresume> queryResumeRequirementsBasedOnStatus(@Param("status") String status,
                                                                      @Param("candidatename") String candidatename,
                                                                      @Param("intendedPosition") String intendedPosition){
        return baseMapper.queryResumeRequirementsBasedOnStatus(status, candidatename, intendedPosition);
    }
    public  List<Candidateresume> queryResumeRequirementsBasedOnStatusAscendingOrder(@Param("status") String status,
                                                                                     @Param("candidatename") String candidatename,
                                                                                     @Param("intendedPosition") String intendedPosition){
        return baseMapper.queryResumeRequirementsBasedOnStatusAscendingOrder(status, candidatename, intendedPosition);
    }
    public  List<Candidateresume> queryResumeRequirementsBasedOnStatusDescendingOrder(@Param("status") String status,
                                                                                      @Param("candidatename") String candidatename,
                                                                                      @Param("intendedPosition") String intendedPosition){
        return baseMapper.queryResumeRequirementsBasedOnStatusDescendingOrder(status, candidatename, intendedPosition);
    }

    public List<Candidateresume> selectCandidateWithInterviewByCandidateId(@Param("CandidateID") String CandidateID){
        return baseMapper.selectCandidateWithInterviewByCandidateId(CandidateID);
    }
    public List<Candidateresume> reviewTheResumeAsNeeded(@Param("status") String status,
                                                         @Param("demandId")String demandId){
        return baseMapper.reviewTheResumeAsNeeded(status, demandId);
    }

    public int updateResumeStatusById(@Param("resumeStatus") String resumeStatus, @Param("candidateid") String candidateid){
        return baseMapper.updateResumeStatusById(resumeStatus, candidateid);
    }

    public  List<Candidateresume> selectCandidateResumesWithDeptStruct(@Param("status") String status){
        return baseMapper.selectCandidateResumesWithDeptStruct(status);
    }
    public  List<Candidateresume> searchCandidateResumesByStatusAndNameOrPost(@Param("status") String status,
                                                                              @Param("candidateName") String candidateName,
                                                                              @Param("postsName") String postsName){
        return baseMapper.searchCandidateResumesByStatusAndNameOrPost(status, candidateName, postsName);
    }

    public List<Candidateresume> searchCandidateResumesByStatusAndNameOrPostASC(@Param("status") String status,
                                                                                 @Param("candidateName") String candidateName,
                                                                                 @Param("postsName") String postsName){
        return baseMapper.searchCandidateResumesByStatusAndNameOrPostASC(status, candidateName, postsName);
    }
    public List<Candidateresume> searchCandidateResumesByStatusAndNameOrPostDESC(@Param("status") String status,
                                                                                 @Param("candidateName") String candidateName,
                                                                                 @Param("postsName") String postsName){
        return baseMapper.searchCandidateResumesByStatusAndNameOrPostDESC(status, candidateName, postsName);
    }
}
